package com.qying.myguava.util;

import java.util.Objects;
import java.util.Spliterator;
import java.util.Spliterators;

/**
 * @Author 秦扬
 * @Date 2021/9/16 11:25
 */
public interface MyIterable<T> {

    MyIterator<T> iterator();

    default void forEach(MyConsumer<? super T> action) {
        Objects.requireNonNull(action);
       /* for (T t : this) {
            action.accept(t);
        }*/
    }

    default Spliterator<T> spliterator(){
        return  null;
        //return Spliterators.spliteratorUnknownSize(iterator(),0);
    }

}
